// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Sprite.java

package presenter;

import java.awt.*;

public class Sprite
{

    public Sprite()
    {
        living = true;
    }

    public Sprite(int x, int y)
    {
        living = true;
        this.x = x;
        this.y = y;
    }

    public boolean isAlive()
    {
        return living;
    }

    public void setAlive(boolean living)
    {
        this.living = living;
    }

    public void setX(int x)
    {
        this.x = x;
    }

    public void setY(int y)
    {
        this.y = y;
    }

    public void setXY(int x, int y)
    {
        this.x = x;
        this.y = y;
    }

    public int getX()
    {
        return x;
    }

    public int getY()
    {
        return y;
    }

    public void moveHorizontally(int magnitude)
    {
        x = x + magnitude;
    }

    public void moveVertically(int magnitude)
    {
        y = y + magnitude;
    }

    public void setImage(Image image)
    {
        this.image = image;
        height = image.getHeight(null);
        width = image.getWidth(null);
    }

    public Image getImage()
    {
        return image;
    }

    public int getHeight()
    {
        return height;
    }

    public int getWidth()
    {
        return width;
    }

    public void setWidth(int width)
    {
        this.width = width;
    }

    public void setHeight(int height)
    {
        this.height = height;
    }

    public void drawSelf(Graphics g)
    {
        g.drawImage(image, x, y, null);
    }

    public void loadImage(String path)
    {
        setImage(Toolkit.getDefaultToolkit().getImage(path));
    }

    private int x;
    private int y;
    private int height;
    private int width;
    private Image image;
    boolean living;
}
